/*
 * log.h
 *
 *  Created on: Sep 6, 2010
 *      Author: thienlong
 */
#include <stdio.h>
#ifdef LIB_EVENT
#include <event2/event.h>

#define LOG_DEBUG _EVENT_LOG_DEBUG
#define LOG_INFO _EVENT_LOG_MSG
#define LOG_WARN _EVENT_LOG_WARN
#define LOG_ERROR _EVENT_LOG_ERR
#else
#define LOG_DEBUG 1
#define LOG_INFO 2
#define LOG_WARN 3
#define LOG_ERROR 4
#endif
#define LOG_OFF 10000;

#define DEBUG
/**
 * the callback discard logging. It do nothing.
 * @param severity
 * @param msg
 */
extern void discard_logging(int severity, const char *msg);

extern void write_log(int severity, const char *msg);

extern void fprintf_log(int severity, const char *fmt, ...);

extern void suppress_logging(void);

extern void set_log_config(char *filename, const char* base_level, int max_bytes, int max_backup);

extern void close_logfile();
